-
-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ad/persistent menu mouseover #35566
Ad/persistent menu mouseover #35566
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One other thing I noticed in the screen shot is that the content of the menu wraps while it is shrinking. I think it would look better if the number of lines does not change during the transition. But I am not sure how hard that would be.
corehq/apps/cloudcare/static/cloudcare/js/formplayer/menus/views.js
Outdated
Show resolved
Hide resolved
corehq/apps/cloudcare/static/cloudcare/js/formplayer/menus/views.js
Outdated
Show resolved
Hide resolved
I agree with this. I'm not sure about how hard it would be either, but I'll give it a go. ...turns out it was incredibly easy 5c682d3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice change, the animation is great! Nit if it's easy to implement - what do you thinking about not having the "opening" animation during navigation if the sidebar is already persistently opened?
Thanks! I think that's a good idea. I'll take a stab at it. I don't think it'll be too big of a lift. ...changed here 0346101 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a couple comments
const contentPlusContainer = $('#content-plus-persistent-menu-container'); | ||
|
||
const persistentMenuRegionClone = $('#persistent-menu-region').clone(); | ||
persistentMenuRegionClone.attr("id","pmr-clone"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the purpose of adding these ids?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
originally the ids were intended to make sure that there weren't cloned elements floating around that would be difficult to search for/trouble shoot. The clones are being removed immediately, so I can see the argument that giving them ids isn't strictly necessary at this point. I'm on the fence about whether it's better to skip adding the ids. I could be swayed either way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there's no use for it now, my preference would be to delete it to remove the chance of confusion of what its purpose is.
corehq/apps/cloudcare/static/cloudcare/js/formplayer/menus/views.js
Outdated
Show resolved
Hide resolved
corehq/apps/cloudcare/static/cloudcare/js/formplayer/menus/views.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes make sense to me. Making the clone to get the width seems a bit hacky but I don't know of a better way to do it. Would be nice to get thoughts from someone more adept at frontend
corehq/apps/cloudcare/templates/cloudcare/partials/menu/persistent_menu.html
Show resolved
Hide resolved
corehq/apps/hqwebapp/static/cloudcare/scss/formplayer-webapp/menu.scss
Outdated
Show resolved
Hide resolved
…ext to wrap while keeping the text from jumping during transition
FWIW, I think this is a normal/appropriate level of hackiness. |
corehq/apps/hqwebapp/static/cloudcare/scss/formplayer-common/navigation.scss
Outdated
Show resolved
Hide resolved
…bs and persistent menu nav should work together while both are available.
…to avoid doubled border. otherwise there is a right border and no top border which looks strange
Product Description
This makes it so that the persistent nav sidebar pops open as an overlay when the user hovers over the collapsed menu.
The menu can be locked open which will do two things.
1: it will fit the nav menu inline with the other elements on the page (no longer an overlay).
2: the nav menu will continue to be expanded as the user navigates between menus.
Technical Summary
Jira ticket for mouseover
In order to have have a transition for the expanding and collapsing you need to know the width the menu will be when expanded. To accomplish this
setPersistantMenuRegionWidth
sets up invisible clones of the elements that make up the nav menu and stores that value insessionStorage
so that it only needs to be calculated once per session. The value,persistantMenuRegionWidth
, is reset when the page is initialized.I looked at the possibility of using a css calc to determine the width, but I don't think that will work. The width will depend on the text content of the menu and the elements need to be appended to the DOM in order to get the correct width.
I'm pretty happy with the current approach, but open to other suggestions.
Jira ticket for defaulting nav menu to closed when split screen case search is on.
Feature Flag
persistent_menu_setting
Safety Assurance
Safety story
tested locally and on staging
changes are limited to this feature flag and the only risk I can see is undesirable ui on the persistent men nav bar.
Automated test coverage
QA Plan
no QA planned
Rollback instructions
Labels & Review